#! /bin/bash

echo "upload ~/.vimrc to remote repository"

if [ ! -e "$HOME/.vimrc" ]
then
	echo "~/.vimrc do not exist"
fi


hostVimrcMtime=`stat -c "%X" $HOME/.vimrc`
remoteVimrcMtime=`stat -c "%X" vimrc`

if [ $remoteVimrcMtime -lt $hostVimrcMtime ]
then
	cp $HOME/.vimrc vimrc
fi



remote=`git remote | head -1`
branch=`git branch | grep -F '*' | sed 's,\* ,,g'`

git add .
git commit -m "update vimrc"
git push $remote $branch 


